<?php

declare(strict_types=1);
/**
 * Created by project.
 * User: huanzipap
 * Date: 2023/5/10
 * Time: 11:25
 */
namespace App\Libs;

class CodeToMessage
{
    /**
     * @param $code
     * @return string|null
     */
    public static function code2Msg ($code): string|null
    {
        $msg = [
            0 => '失败',
            1 => '成功',
            10001 => '前往授权',
            10002 => '请先登录',
            10003 => '授权callback地址丢失',
            10004 => '版本信息错误',
            10005 => '路由参数丢失',
            10006 => '分享callback地址丢失',
            10007 => '提交信息不完整',
            10008 => '信息不存在',
            10009 => '无权操作',
            10010 => '不可重复操作',
            50001 => '系统错误',
            50002 => '微信系统错误'
        ];

        return $msg[$code] ?? null;
    }
}